ajax('/admin/data/info', function (data) {
    if (data.code == 200) {
        document.querySelectorAll('.spannel em')[0].innerHTML = data.totalArticle
        document.querySelectorAll('.spannel em')[1].innerHTML = data.dayArticle
        document.querySelectorAll('.spannel em')[2].innerHTML = data.totalComment
        document.querySelectorAll('.spannel em')[3].innerHTML = data.dayComment
    }

})
ajax('/admin/data/article', function (data) {
    if (data.code == 200) {
        let date = []
        let count = []
        let chartDom = document.getElementById('curve_show');
        let myChart = echarts.init(chartDom);
        let option;
        for (let i = 0; i < data.date.length; i++) {
            date.push(data.date[i].date)
            count.push(data.date[i].count)
        }
        console.log(date, count)
        option = {
            xAxis: {
                type: 'category',
                data: date
            },
            yAxis: {
                type: 'value'
            },
            series: [{
                data: count,
                type: 'line',
                smooth: true
            }]
        };
        myChart.setOption(option);
    }
})